package com.xingzhe.pengji.framework.exception;

import org.json.JSONException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;

import com.xingzhe.pengji.framework.bean.BaseObjLog;
import com.xingzhe.pengji.framework.log.PjLogger;


public class BaseControllerException extends BaseObjLog
{
    @Autowired
    private PjLogger pjLogger;
    
    @ExceptionHandler(JSONException.class)
    @ResponseStatus(value = HttpStatus.NOT_FOUND, reason="No data found matching criteria")
    public void jsonException() 
    {
        getLog().error("Json 错误！");
    }

    public PjLogger getPjLogger()
    {
        return pjLogger;
    }

    public void setPjLogger(PjLogger pjLogger)
    {
        this.pjLogger = pjLogger;
    }
    
    
}
